const path = require('path')
const resolve = (dir) => path.join(__dirname, dir)
module.exports = {
    publicPath: './',
    assetsDir: "static", // 静态资源存放的文件夹(相对于ouputDir)
    devServer: {
        host: '0.0.0.0',
        port: 18080,
        proxy: {
            '/api': {
                target: 'http://jajava.cn/',
                changeOrigin: true,
                pathRewrite: {
                    '^/api': '/api'
                }
            },
            '/codeApi': {
                target: 'http://jajava.cn:8080/',
                // target: 'http://localhost:8080/',
                changeOrigin: true,
                pathRewrite: {
                    '^/codeApi': ''
                }
            }
        }
    },
    chainWebpack: config => {
        config.resolve.alias // 添加别名
            .set('@', resolve('src'))
            .set('@assets', resolve('src/assets'))
            .set('@components', resolve('src/components'))
            .set('@views', resolve('src/views'))
            .set('@store', resolve('src/store'))

    }
}
